fix(server): check Homebrew for provider updates on Homebrew installs - #7731
fix(server): check Homebrew for provider updates on Homebrew installs#7731ishaanko wants to merge 1 commit into
Conversation
|
You have reached your Codex usage limits for code reviews. You can see your limits in the Codex usage dashboard. |
|
Important Review skippedAuto reviews are disabled on this repository. Please check the settings in the CodeRabbit UI or the ⚙️ Run configurationConfiguration used: Repository UI Review profile: CHILL Plan: Pro Plus Run ID: You can disable this status message by setting the Use the checkbox below for a quick retry:
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
ApprovabilityVerdict: Not approved Macroscope's review found this PR not approvable — This PR changes runtime behavior by modifying how provider version checks work for Homebrew installs - introducing new HTTP calls to Homebrew's API (formulae.brew.sh) instead of npm. This behavioral change to the update-checking system warrants human review. You can add or adjust custom eligibility rules. Learn more. |
Provider update advisories compared the installed version against npm's latest for every install kind. A Homebrew-managed Codex or Claude is flagged as outdated the moment a release hits npm, and the offered `brew upgrade` cannot clear it until the cask catches up, so the nag never goes away. Homebrew-managed installs now resolve the latest version from formulae.brew.sh (cask first, then formula), which is what `brew upgrade` can actually deliver. Third-party taps keep npm since they have no public API. Everything else is unchanged.
4a2d57c to
22d5767
Compare
What Changed
Provider update advisories compared the installed version against npm's latest for every install kind. A Homebrew-managed Codex or Claude is flagged as outdated the moment a release hits npm, and the offered
brew upgradecannot clear it until the cask is bumped, so the nag never goes away.ProviderMaintenanceCapabilitiesnow carrieshomebrewFormula, set only when the install resolves through Homebrew. For those installsresolveLatestProviderVersionreads the latest version fromformulae.brew.sh(cask first, then formula), which is the same JSON APIbrewinstalls from and therefore exactly whatbrew upgradecan deliver. Cask build suffixes (1.2.3,4567) are stripped before the semver compare. Third-party taps (anomalyco/tap/opencode) have no public API and keep npm. npm, bun, pnpm, Vite+, and native installs are unchanged.Fixes #7730
Why
npm and the Homebrew cask publish at different times. Today
@openai/codex@0.149.0hit npm at 21:04Z while the cask is still at 0.148.0. The app asked forbrew upgrade codex, which had nothing to do, and kept showing "update available". Comparing against the source the update command actually pulls from makes the advisory and the button agree.UI Changes
None.
Checklist
Test plan
vp test run src/provider/providerMaintenance.test.ts21/21, with three new cases: Homebrew cask lookup (and build-suffix strip), formula fallback when the name is not a cask, third-party tap stays on npmproviderMaintenanceRunner,makeManagedServerProvider,ProviderRegistrytests 61/61tsgo --noEmitfor apps/server, targeted lint and fmt0.148.0(reads as current), npm-managed resolves0.149.0Written by Claude Fable 5 via Claude Code.
Note
Medium Risk
Changes provider update advisory logic and outbound HTTP (npm vs Homebrew APIs), which can affect when users see update prompts and what version is considered “latest” for Homebrew installs.
Overview
Fixes false “update available” advisories when a provider is installed via Homebrew but npm has already published a newer release. The advisory and
brew upgradenow compare against the same source Homebrew can actually deliver.ProviderMaintenanceCapabilitiesaddshomebrewFormulafor Homebrew-managed installs.resolveLatestProviderVersionpicks the latest-version source viaresolveLatestVersionSource: core formulas/casks (no/in the name) useformulae.brew.sh(cask API first, formula fallback, comma-stripped cask versions); third-party taps and npm/bun/pnpm/native installs still use npm. Version cache keys are split (homebrew:<name>vs npm package name). HTTP lookup is centralized infetchJson.Tests add Homebrew cask/formula/tap scenarios and expect
homebrewFormula: nullon non-Homebrew capability shapes.Reviewed by Cursor Bugbot for commit 22d5767. Bugbot is set up for automated code reviews on this repo. Configure here.
Note
Add Homebrew formula/cask version checks to
resolveLatestProviderVersionformulae.brew.shinstead of npm.fetchHomebrewLatestVersiontries the cask endpoint first, then falls back to the formula endpoint, stripping build suffixes after a comma.ProviderMaintenanceCapabilitiesgains a readonlyhomebrewFormulafield (string or null) that records the formula/cask name for Homebrew-managed installs.resolveLatestVersionSourcepicks Homebrew for core formulas (no slash in the name), keeps npm for third-party taps and npm installs, and returns no source otherwise.fetchJsonhelper centralizes HTTP GET, timeout, status check, and Schema decode logic; npm version lookup is refactored to use it with no behavior change.resolveLatestProviderVersionnow uses separate cache keys (homebrew:<name>vs npm package name) and may return a version sourced from Homebrew rather than npm for Homebrew-managed installs.Macroscope summarized 22d5767.